
import { lazy } from "react";
var Index=lazy(()=>import('../views/Index'))
var Login=lazy(()=>import('../views/Login'))
var Register = lazy(()=>import('../views/Register'))
var Collect=lazy(()=>import('../views/Collect'))
var Detail=lazy(()=>import('../views/Detail'))
var Search=lazy(()=>import('../views/Search'))
var NotFound=lazy(()=>import('../views/NotFound'))

var Home = lazy(()=>import('../views/Index/Home'))
var Cate = lazy(()=>import('../views/Index/Cate'))
var Goods = lazy(()=>import('../views/Index/Goods'))
var Mine = lazy(()=>import('../views/Index/Mine'))
var ShopCart = lazy(()=>import('../views/Index/ShopCart'))
export default [
    {
        path:'/index',
        component:Index,
        children:[
            {
                path:'/index/home',
                component:Home
            },
            {
                path:'/index/cate',
                component:Cate
            },
            {
                path:'/index/goods',
                component:Goods
            },
            {
                path:'/index/shopcart',
                component:ShopCart
            },
            {
                path:'/index/mine',
                component:Mine
            },
            {
                from:'/index',
                to:'/index/home',
                redirect:true
            },
            {
                component:NotFound
            }
        ]
    },
    {
        path:'/login',
        component:Login
    },
    {
        path:'/register',
        component:Register
    },
    {
        path:'/collect',
        component:Collect
    },
    {
        path:'/detail',
        component:Detail
    },
    {
        path:'/search',
        component:Search
    },
    {
        from:'/',
        to:'/index',
    },
    {
        component:NotFound
    }
]
